package com.asset.dispoal.role.service;

import com.asset.dispoal.role.api.GbRoleService;
import com.asset.dispoal.role.dto.GbRoleRequest;
import com.asset.dispoal.role.dto.GbRoleResponse;
import com.asset.dispoal.role.service.commom.DeleteRoleCommand;
import com.asset.dispoal.role.service.commom.InsertRoleCommand;
import com.asset.dispoal.role.service.commom.QueryRoleCommand;
import com.asset.dispoal.role.service.commom.UpdateRoleCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;


/**
 * 角色表服务实现类
 *
 * @author: mhuang
 * @date: 2022-03-01 15:30:18
 */
@Service
public class GbRoleServiceImpl implements GbRoleService {

    @Autowired
    DeleteRoleCommand deleteRoleCommand;

    @Autowired
    InsertRoleCommand insertRoleCommand;

    @Autowired
    QueryRoleCommand queryRoleCommand;

    @Autowired
    UpdateRoleCommand updateRoleCommand;

    @Override
    public void insert(GbRoleRequest request) {
        insertRoleCommand.execute(request);
    }

    @Override
    public void update(GbRoleRequest request) {
        updateRoleCommand.execute(request);
    }

    @Override
    public void delete(String id) {
        deleteRoleCommand.execute(id);
    }

    @Override
    public Result<PageVO<GbRoleResponse>> queryPage(GbRoleRequest request) {
        return queryRoleCommand.execute(request);
    }
}